package com.insigma.business.qrcode.merchant.controller;

import com.alibaba.fastjson.JSONObject;
import com.insigma.business.qrcode.common.template.BasePagingResponse;
import com.insigma.business.qrcode.common.vo.BaseResponse;
import com.insigma.business.qrcode.merchant.dto.CareWelfareMerchantEntryApplyDTO;
import com.insigma.business.qrcode.merchant.dto.request.CareWelfareMerchantEntryApplyInsertRequest;
import com.insigma.business.qrcode.merchant.dto.request.CareWelfareMerchantEntryApplySearchRequest;
import com.insigma.business.qrcode.merchant.dto.request.CareWelfareMerchantEntryApplyUpdateRequest;
import com.insigma.business.qrcode.merchant.service.MerchantEnterService;
import com.insigma.business.qrcode.soldier.request.BaseGetRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 商家入驻管理
 */
@Api("商家入驻管理")
@RestController
@RequestMapping("/merchantEnter")
public class MerchantEnterController {
    @Autowired
    private MerchantEnterService merchantEnterService;

    @ApiOperation("商家入驻申请")
    @PostMapping("/enterApply")
    public BaseResponse<Integer> enterApply(@RequestBody CareWelfareMerchantEntryApplyInsertRequest request){
        return merchantEnterService.enterApply(request);
    }

    @ApiOperation("入驻审核查询")
    @PostMapping("/getEnterApplyList")
    public BasePagingResponse<List<CareWelfareMerchantEntryApplyDTO>> getApplyList(@RequestBody CareWelfareMerchantEntryApplySearchRequest request){
        return merchantEnterService.getApplyList(request);
    }

    @ApiOperation("入驻审核明细")
    @PostMapping("/getEnterApplyDetail")
    public BaseResponse<CareWelfareMerchantEntryApplyDTO> getApplyDetail(@RequestBody BaseGetRequest baseGetRequest){
        return merchantEnterService.getApplyDetail(baseGetRequest);
    }

    @ApiOperation("入驻审核")
    @PostMapping("/enterAudit")
    public BaseResponse<Integer> enterAudit(@RequestBody CareWelfareMerchantEntryApplyUpdateRequest req){
        return merchantEnterService.enterAudit(req);
    }
}
